package com.hp.service.impl;

import com.github.pagehelper.PageHelper;
import com.hp.entity.Announcement;
import com.hp.mapper.AnnouncementMapper;
import com.hp.service.AnnouncementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AnnouncementServiceImpl implements AnnouncementService {
    @Autowired
    AnnouncementMapper announcementMapper;
    @Override
    public List<Announcement> queryAll(Announcement announcement, Integer page, Integer limit) {
        PageHelper.startPage(page, limit);
        return announcementMapper.queryAll(announcement);
    }

    @Override
    public int insert(Announcement announcement) {
        return announcementMapper.insert(announcement);
    }

    @Override
    public int del(Integer id) {
        return announcementMapper.del(id);
    }

    @Override
    public Announcement findId(Integer id) {
        return announcementMapper.findId(id);
    }

    @Override
    public int update(Announcement announcement) {
        return announcementMapper.update(announcement);
    }
}
